package com.example.onlinemusicserver2024.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.onlinemusicserver2024.common.R;
import com.example.onlinemusicserver2024.mapper.ListSongMapper;
import com.example.onlinemusicserver2024.model.domain.ListSong;
import com.example.onlinemusicserver2024.service.ListSongService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ListSongServiceImpl extends ServiceImpl<ListSongMapper, ListSong> implements ListSongService {
    @Autowired
    ListSongMapper listSongMapper;
    @Override
    public R getSongsByListSongId(int songListId) {
        // 设置查询条件
        QueryWrapper<ListSong> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("song_list_id",songListId);
        List<ListSong>  listSongs = listSongMapper.selectList(queryWrapper);
        return R.success("查询成功",listSongs);
    }
}
